import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import {Observable} from "rxjs/Observable";
import "rxjs/add/observable/of";

import {StaffOnjob} from '../../../model/pages/my-team/team-staff-onjob/team-staff-onjob.model';

/*
  Generated class for the StaffProvider provider.

  See https://angular.io/guide/dependency-injection for more info on providers
  and Angular DI.
*/
@Injectable()
export class StaffOnjobProvider {

  /**
   * mock员工数据
   */
  public staffs:any[]=[
    {
      groupId:'1',
      groupName:'张扬姗姗组',
      agentCode:'SH0002',
      agentName:'张扬姗姗',
      level:'FA',
      birthday:'1975/04/08',
      workingTime:'1年2个月',
      isBirthday: 1,
      isAnniversary:0
    },
    {
      groupId:'2',
      groupName:'艾中宏组',
      agentCode:'SH0003',
      agentName:'Channing Tatum',
      level:'FA',
      birthday:'1974/12/07',
      workingTime:'1年',
      isBirthday: 0,
      isAnniversary:1
    },
    {
      groupId:'3',
      groupName:'李香兰组',
      agentCode:'SH0004',
      agentName:'艾四',
      level:'FA',
      birthday:'1975/03/05',
      workingTime:'1年1个月',
      isBirthday: 0,
      isAnniversary:0
    },
    {
      groupId:'2',
      groupName:'艾中宏组',
      agentCode:'SH0005',
      agentName:'艾中宏',
      level:'SUM',
      birthday:'1975/06/08',
      workingTime:'9个月',
      isBirthday: 0,
      isAnniversary:0
    },
    {
      groupId:'1',
      groupName:'张扬姗姗组',
      agentCode:'SH0002',
      agentName:'张扬姗姗',
      level:'FA',
      birthday:'1975/04/08',
      workingTime:'1年2个月',
      isBirthday: 1,
      isAnniversary:0
    },
    {
      groupId:'2',
      groupName:'艾中宏组',
      agentCode:'SH0003',
      agentName:'Channing Tatum',
      level:'FA',
      birthday:'1974/12/07',
      workingTime:'1年',
      isBirthday: 0,
      isAnniversary:1
    },
    {
      groupId:'3',
      groupName:'李香兰组',
      agentCode:'SH0004',
      agentName:'艾四',
      level:'FA',
      birthday:'1975/03/05',
      workingTime:'1年1个月',
      isBirthday: 0,
      isAnniversary:0
    },
    {
      groupId:'2',
      groupName:'艾中宏组',
      agentCode:'SH0005',
      agentName:'艾中宏',
      level:'SUM',
      birthday:'1975/06/08',
      workingTime:'9个月',
      isBirthday: 0,
      isAnniversary:0
    },
    {
      groupId:'1',
      groupName:'张扬姗姗组',
      agentCode:'SH0002',
      agentName:'张扬姗姗',
      level:'FA',
      birthday:'1975/04/08',
      workingTime:'1年2个月',
      isBirthday: 1,
      isAnniversary:0
    },
    {
      groupId:'2',
      groupName:'艾中宏组',
      agentCode:'SH0003',
      agentName:'Channing Tatum',
      level:'FA',
      birthday:'1974/12/07',
      workingTime:'1年',
      isBirthday: 0,
      isAnniversary:1
    },
    {
      groupId:'3',
      groupName:'李香兰组',
      agentCode:'SH0004',
      agentName:'艾四',
      level:'FA',
      birthday:'1975/03/05',
      workingTime:'1年1个月',
      isBirthday: 0,
      isAnniversary:0
    },
    {
      groupId:'2',
      groupName:'艾中宏组',
      agentCode:'SH0005',
      agentName:'艾中宏',
      level:'SUM',
      birthday:'1975/06/08',
      workingTime:'9个月',
      isBirthday: 0,
      isAnniversary:0
    }
  ];

  constructor(public http: HttpClient) {
  }

  /**
   * 获取员工信息
   */
  getStaffInfo():Observable<any> {
    let url="/recruit/incumbent/v1/on_job_agent";
    // return this.staffs; //测试
    return this.http.get(url);
  }

}
